//
// Created by Jisam on 2024/6/18.
//
// 20点45分
#include <bits/stdc++.h>

using  namespace  std;
#define  int long long
signed main (){
    int T;
    cin >> T;
    while (T --){
        int n;
        cin >> n;
        if(n % 3 == 0){
            cout << 1 << " " << n/3 <<"\n";
        }else{
            cout << 0 << " " << n % 3 + n / 3<<"\n";
        }
    }
    return  0;
}